package com.zkthink.ceres.common.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

/**
 * @ClassName EstateTypeEnum
 * @Description: EstateTypeEnum
 * @Author ck
 * @Date 2021/11/12
 * @Version V1.0
 **/

@Getter
public enum EstateTypeEnum {
    BX_ESTATE(0, "不限"),
    SZF_ESTATE(1, "商住房"),
    MMF_ESTATE(2, "门面房"),
    ZJF_ESTATE(3, "自建房"),
    AZF_ESTATE(4, "安置房"),
    DTF_ESTATE(5, "多套房"),
    NO_ESTATE(6, "无房");

    private int code;

    private String desc;

    EstateTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static EstateTypeEnum getDscByType(Integer type) {
        for (EstateTypeEnum p : values()) {
            if (p.getCode() == type.intValue()) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}
